package com.whu.tcx01.utils;

import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.stream.Collectors;


//去除List中重复项
public class ListSet {
    public static List<String> removeRepeat(List<String> CoorList){
        LinkedHashSet hashSet = new LinkedHashSet<>(CoorList);
        List<String> listNoRepeat = new ArrayList<>(hashSet);
        return listNoRepeat;
    }
    public static List<String> removeRepeat2(List<String> CoorList){
        List<String> listWithoutDuplicates = CoorList.stream().distinct().collect(Collectors.toList());
        return listWithoutDuplicates;
    }
}
